bindHtml()
async function bindHtml(){
 let interface = await pAjax(
     {url:'../server/scenics.php',data:{pid:2},dataType:'json' } )
let {data:bjarr} = interface
//  遍历数组
let bjdd = bjarr.map(v=>{ return` <li class="items" >
                         <a href=" javascript:; ">
                             <img src="${v.imgpath.split('==========')[0]}" alt="" class="img1">
                             <p class="name2">${v.name}</p>
                             <p class="desc2">${v.introduce}</p>
                             <p class="price2">${v.price}
                                 <del>1699元</del>
                             </p>
                             <p class="open" index=${v.id}>查看详情</P>
                         </a>
                     </li>`}).join(' ');
$('.home-box-right>ul').html(bjdd)   
}

$('.home-box-right>ul').on('click','.open', function(){
    let id = $(this).attr('index');
    // 将商品id存储到sessionStorage中  在跳转的页面中页面方法到商品的id
    sessionStorage.setItem('goodsId',id);
    // 跳转
    location.href = './detail.html';
    return false;// 阻止默认跳转
})

anhui()
async function anhui(){
 let inter= await pAjax(
     {url:'../server/scenics.php',data:{pid:13},dataType:'json' } )
let {data:aharr} = inter
//  遍历数组
let  ahdd = aharr.map(v=>{ return` <li class="items">
                         <a href=" javascript:; ">
                             <img src="${v.imgpath.split('==========')[0]}" alt="" class="img1">
                             <p class="name2">${v.name}</p>
                             <p class="desc2">${v.introduce}</p>
                             <p class="price2">${v.price}
                                 <del>1699元</del>
                             </p>
                             <p class="open" index=${v.id}>查看详情</P>
                         </a>
                     </li>`}).join(' ');
$('.brick-bd-right>ul').html(ahdd)   
}

$('.brick-bd-right>ul').on('click','.open', function(){
    let id = $(this).attr('index');
    // 将商品id存储到sessionStorage中  在跳转的页面中页面方法到商品的id
    sessionStorage.setItem('goodsId',id);
    // 跳转
    location.href = './detail.html';
    return false;// 阻止默认跳转
})